package com.rd.student.jiaji.class3.caiyuxin.java7_31;

public class RonNum1 {
    public static void main(String[] args) {
        int[] sum=new int[50];
        int[] ron=new int[20];

        int count=0;
        for (int i=0;i<50;i++){
            sum[i]=-1;
        }
        while(count<20){

            int r= (int) (Math.random()*50);
            System.out.println("随机数"+r);
            if (sum[r]==-1){
                sum[r]=r;
                ron[count]=r;
                count++;

            }


        }
        for (int i=0;i<ron.length;i++) {
            System.out.print(ron[i]+" ");
        }

    }
}
